docker run -p 23306:3306 --name mysql5.7 \
-v /mydata/docker/mysql5.7/log:/var/log/mysql \
-v /mydata/docker/mysql5.7/data:/var/lib/mysql \
-v /mydata/docker/mysql5.7/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql:5.7


测试运行Ok
docker run -p 23306:3306 --name mysql5.7 \
--privileged=true    \
-v /opt/docker/mysql5.7/log:/var/log/mysql \
-v /opt/docker/mysql5.7/data:/var/lib/mysql \
-v /opt/docker/mysql5.7/conf:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql:5.7


docker run -p 23306:3306 --name mysql5.7 \
-v /opt/docker/mysql5.7/log:/var/log/mysql \
-v /opt/docker/mysql5.7/data:/var/lib/mysql \
-v /opt/docker/mysql5.7/conf:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=123456 \
-d mysql:5.7


指定配置文件路径
mysqld --defaults-file=/etc/mysql/my-custom.cnf